from common.models import db
from datetime import datetime
from common.models.coures import *

class User(db.Model):
    """用户信息表"""
    __tablename__ = 'tb_user'

    uid = db.Column(db.Integer, primary_key=True, autoincrement=True, doc="用户id")
    uname = db.Column(db.String(32), doc="用户名")
    mobile = db.Column(db.String(32), doc="手机号")
    password = db.Column(db.String(256), doc="密码")
    account = db.Column(db.String(32), unique=True, doc="账号")






class OauthUser(db.Model):
    __tablename__ = 'oauth_user'
    id = db.Column(db.Integer, primary_key=True, autoincrement=True ,doc='oauth_user id')
    image = db.Column(db.String(256), doc='头像')
    oauth_id = db.Column(db.String(512), doc='第三方登录的id')
    user = db.Column(db.Integer, db.ForeignKey("tb_user.uid", ondelete="CASCADE"))
    oauth_type = db.Column(db.String(128), doc='第三方登录类型')




